<template>
    <el-tree :data="data" :props="defaultProps"></el-tree>
  </template>
  
  <script>
  export default {
    data() {
      return {
        data: [
          {
            id: 1,
            label: '部门一',
            children: [
              {
                id: 11,
                label: '子部门一'
              },
              {
                id: 12,
                label: '子部门二'
              }
            ]
          },
          {
            id: 2,
            label: '部门二',
            children: [
              {
                id: 21,
                label: '子部门一'
              },
              {
                id: 22,
                label: '子部门二'
              }
            ]
          }
        ],
        defaultProps: {
          children: 'children',
          label: 'label'
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .el-tree-node__content {
    padding: 10px 0;
  }
  
  .el-tree-node__content:hover {
    background-color: #f5f7fa;
  }
  
  .el-tree-node__expand-icon {
    color: #999;
    font-size: 12px;
  }
  
  .el-tree-node__expand-icon:hover {
    color: #409eff;
    cursor: pointer;
  }
  </style>
  